<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<html>
	<head>


		<title>代理列表</title>
		<%
			request.setCharacterEncoding("UTF-8");
		%>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<script type="text/javascript">
     function addAgent(id){
       document.getElementById(id).style.display="block";
     }
     function disDiv(id){
     document.getElementById(id).style.display="none";
     }
     
     function disableMember(id){
     	document.all('member.uno').value=id;
     	document.all('member.status').value="冻结";
     	document.all('updateStatus').submit();
     }

   </script>

		<link rel="stylesheet" href="../css/style.css" type="text/css"></link>
	</head>

	<body>
		<div>
			<input type="button" value="新增会员" onclick="addAgent('addAgent')" />
		</div>
		<div>
			<table width="100%" style="border-width: 1px; border-style: solid;">
				<tr align="center">
					<td>
						登录名
					</td>
					<td>
						真实姓名
					</td>
					<td>
						电话
					</td>
					<td>
						基本额度
					</td>
					<td>
						剩余额度
					</td>
					<td>
						状态
					</td>
					<td>
						操作
					</td>
				</tr>
				<s:iterator value="pager.data">
					<tr align="center">
						<td>
							<s:property value="uname" />
						</td>
						<td>
							<s:property value="trueName" />
						</td>
						<td>
							<s:property value="tel" />
						</td>
						<td>
							<s:property value="baseAmount" />
						</td>
						<td>
							<s:property value="balance" />
						</td>
						<td>
							<s:property value="status" />
						</td>
						<td>
							<a
								href="/newbingo/test/Member_deleteMember.action?member.uno=${uno }">删除</a>&nbsp;&nbsp;
							<a
								href="/newbingo/test/TradeRecord_findByPage.action?uno=${uno }">交易记录</a>&nbsp;&nbsp;
							<a
								href="/newbingo/test/Member_findHistoryBetByMemberId.action?member.uno=${uno }">投注记录</a>
							<a href="javascript:disableMember(${uno })">禁用</a>
						</td>
					</tr>
				</s:iterator>
			</table>
		</div>

		<div id="addAgent" style="display: none;">
			<form action="/newbingo/test/Member_createNewMember.action"
				method="post" id="createForm">
				新增会员：
				<!-- 隐藏 -->
				<input type="hidden" value="${user.uno }" name="member.agent.uno" />
				<table>
					<tr>
						<td>
							登录名：
						</td>
						<td>
							<input name="member.uname" />
						</td>
					</tr>
					<tr>
						<td>
							密码：
						</td>
						<td>
							<input type="password" name="member.upwd" />
						</td>
					</tr>
					<tr>
						<td>
							真实姓名：
						</td>
						<td>
							<input name="member.trueName" />
						</td>
					</tr>
					<tr>
						<td>
							电话：
						</td>
						<td>
							<input name="member.contactInfo.tel" />
						</td>
					</tr>
					<tr>
						<td>
							Email：
						</td>
						<td>
							<input name="member.contactInfo.email" />
						</td>
					</tr>
					<tr>
						<td>
							最大投注额：
						</td>
						<td>
							<input name="member.maxBet" />
						</td>
					</tr>
					<tr>
						<td>
							最小投注额
						</td>
						<td>
							<input name="member.minBet" />
						</td>
					</tr>
					<tr>
						<td>
							开户金额
						</td>
						<td>
							<input name="member.account.amount" value="0" />
						</td>
					</tr>
				</table>
				<input type="submit" value="保存" />
				&nbsp;&nbsp;
				<input type="button" value="取消" onclick="disDiv('addAgent')" />
			</form>
		</div>
		<form name="updateStatus"
			action="/newbingo/test/Member_updateMemberStatus.action"
			method="post">
			<input name="member.uno" type="hidden" />
			<input name="member.status" type="hidden" />
		</form>
	</body>
</html>
